package com.myf.entities;

import com.baomidou.mybatisplus.annotation.TableField;
import com.myf.typeHandlers.ZonedDateTimeTypeHandler;
import org.apache.ibatis.type.JdbcType;

import java.time.ZonedDateTime;

public class BaseEntity {
    @TableField(value = "create_at", jdbcType = JdbcType.TIMESTAMP_WITH_TIMEZONE, typeHandler = ZonedDateTimeTypeHandler.class)
    public ZonedDateTime createAt;

    @TableField(value = "create_by")
    public Integer createBy;

    @TableField(value = "update_at", jdbcType = JdbcType.TIMESTAMP_WITH_TIMEZONE, typeHandler = ZonedDateTimeTypeHandler.class)
    public ZonedDateTime updateAt;

    @TableField(value = "update_by")
    public Integer updateBy;

    @TableField(value = "delete_at", jdbcType = JdbcType.TIMESTAMP_WITH_TIMEZONE, typeHandler = ZonedDateTimeTypeHandler.class)
    public ZonedDateTime deleteAt;

    @TableField(value = "delete_by")
    public Integer deleteBy;

    @TableField(value = "row_version",update = "%s+1")
    public int version;
}
